package com.jettech.oa.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * 公文审核记录信息
 * @author Administrator
 *
 */
@Entity
@Table(name="jettech_approve_info")
public class DocumentApproveInfo {
	private Long id;
	private Document document;//被审核的公文
	private User user;//审核者
	private Date approveTiem;//审核时间
	private String comment;//审核内容
	public DocumentApproveInfo(){
		
	}
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="approve_info_id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="document_id")
	public Document getDocument() {
		return document;
	}
	public void setDocument(Document document) {
		this.document = document;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="user_id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@Column(name="approve_time")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getApproveTiem() {
		return approveTiem;
	}
	public void setApproveTiem(Date approveTiem) {
		this.approveTiem = approveTiem;
	}
	@Column(name="approve_comment")
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public boolean equals(Object other){
		return EqualsBuilder.reflectionEquals(this, other);
	}
	public int hashCode(){
		return HashCodeBuilder.reflectionHashCode(this);
	}
	public String toString(){
		return ToStringBuilder.reflectionToString(this);
	}
}
